// import * as im from "../ymVoice/ymMgr";
/**
 * 用于单机游戏
 */
class singleGame extends eui.Component {
	private yaogan: roleControl;
	/**四号道具 */
	private daotime = Date.now();
	private rr = 0;
	public camera: control.Camera2D;
	public lenght11: number//舌头长度
	private background: eui.Group = new eui.Group();

	private brorder: eui.Group = new eui.Group();
	/**玩家类型 */
	private clothes_List = ["lv", "huang", "qing"];
	//保存玩家的位置
	public myControlPoint = {
		x: 0,
		y: 0
	};
	//用于手柄部分
	public handle: eui.Image = new eui.Image();//小球
	private circle: eui.Image = new eui.Image();//圈
	private circle_position = { "x": 100, "y": gameGlobal.global.screenHeight - 100 };//圈中心点的位置
	private handle_position = { "x": 100, "y": gameGlobal.global.screenHeight - 100 };//小球中心店的位置
	private touchID: any = null;//触摸id
	private circle_radius: number = 0;
	private handle_radius: number = 0;
	private jiaodu: number = 0;//返回角度
	private container: any;
	public gameMapss: any;
	public isShowTop = false;
	/**背景音乐 */
	//	private bgSound: soundMgr = new soundMgr();

	/**AI管理类 */
	//private aimgr: AIMgr;

	/**用于存储玩家是否死亡 控制是否接受服务器消息 */
	public isUserDied = false;
	public liubianxing: eui.Group;//背景添加六边形
	/**影子青蛙移动数据 */
	private m_shadowFrog;
	/**创建 */
	public constructor() {
		super();
		this.skinName = "resource/assets/skins/gameMapSkin.exml";
		this.once(egret.Event.ADDED_TO_STAGE, this.initialize, this);
	}
	/**初始化 */
	private initialize() {
		
		resManager.getInstance().loadRes();
		this.init();
		this.yaoganInit();
		this.parent.addChild(this.UiLayer);
		this.UiLayer.addChild(this.playerPanel);
		this.gameStart();
		this.changeVisibility(DataProl.gameSceneScal);

		// for (var i: number = 0; i < 6; i++) {//背景添加六边形
		// 	for (var t: number = 0; t < 7; t++) {
		// 		var bit: eui.Image = new eui.Image();
		// 		bit.texture = RES.getRes("liubianxing22_png");
		// 		bit.x = 496 * t + 248 * (i % 2);
		// 		bit.y = 431.25 * i;
		// 		this.liubianxing.addChild(bit);
		// 	}
		// }
	}
	/**相关数据 */

	private con = gameGlobal;
	private config = this.con.global;//account
	/**玩家信息 */
	public player = {
		id: -DataProl.playerOpenid,
		x: this.config.screenWidth / 2,
		y: this.config.screenHeight / 2,
		type: Math.round(Math.random() * 2 + 0),
		screenWidth: this.config.screenWidth,
		screenHeight: this.config.screenHeight,
		target: { x: this.config.screenWidth / 2, y: this.config.screenHeight / 2 },
		name: gameGlobal.global.playerName,
		hue: null,
		massTotal: null,
		cells: null,
		xoffset: -0,
		yoffset: -0
	};

	//显示玩家的青蛙
	private myUser = { targetx: 0, targety: 0, userSprit: null };

	private get User() {
		return this.myUser.userSprit;
	}


	/**装饰品 */
	private decoration_List = ["lowpoly", "food"];
	/**线层*/
	private tongueLayer: egret.Sprite = new egret.Sprite();
	/**道具层 */
	private propLayer: egret.Sprite = new egret.Sprite();
	/**UI层 */
	private UiLayer: eui.Component = new eui.Component();
	/**游戏结束/死亡*/
	private GameOver: GameOver = new GameOver();
	/**玩家面板信息/用于显示玩家信息 */
	private playerPanel: playerPanel = new playerPanel(this);
	/**；存房间玩家/青蛙 动画的容器 */
	private gameFrog = new eui.Group();
	/**青蛙管理类 */
	public m_createAllFrogs = new frogMgr(this);
	public map: eui.Group;
	public shitou: eui.Group;

	/**房间内的线 */
	public roomAllTongue: egret.Sprite = new egret.Sprite();



	private game_Timer: egret.Timer;

	/**道具管理 */
	private m_propMg: propMgr = new propMgr(this.propLayer);
	// /**缩放目标倍数 */
	// private zoomTarget: number = -1;
	// /**当前缩放倍数 */
	// private zoomNow: number = -1;
	public drawGroup: eui.Group;

	/**商品管理类 */
	public m_gameShopMgr: gameShopView = new gameShopView(this);
	/**游戏循环定时器 */
	private moveLoop: egret.Timer = new egret.Timer(1000 / 60, -1);
	private game_TimerT = new egret.Timer(1000, -1);
	//---------------复活框部分-----------------------
	/**玩家死亡 */
	private userDied: playerDied;
	/**复活框 */
	public resurrectionBox: eui.Group;
	/**复活框倒计时文字 */
	private countDownTime: eui.Label;
	/**复活框提示文字 */
	private wenzi: eui.Label;


	//定时调用AIserver MOVE
	private AIServerUpdate(event: egret.TimerEvent) {
		AIServer.getInstance().updata();
		AIServer.getInstance().gameLoops();
		this.game_Loop();
		event.updateAfterEvent();
	}

	private init() {
		//this.resetShadowForgStates();
		DataProl.killnumMax = 0;
		this.mapScaleInit();
		webNetworkMananger.getInstance().gameSceneRec = this;
		this.m_createAllFrogs.createAllFrogs();
		if (serverConfig.config.shadowFrog == 1) {
			//影子青初始化
			let shadowFrog = this.m_createAllFrogs.findFrogById(DataProl.shadowFrogId);
			if (shadowFrog != null) {

				shadowFrog.reset();
			}

			this.m_shadowFrog = this.m_createAllFrogs.getOneFrog();
			this.m_shadowFrog.born(DataProl.shadowFrogId, "影子", 200, 200, 1, 1, null);

			this.m_shadowFrog.visble = true;
		}

		this.mapInit();
		this.cameraInit();
		this.creatMyFog();
		this.UiLayer.width = GlobalData.GameStage_width * DataProl.gameSceneScal;
		this.UiLayer.height = GlobalData.GameStage_height * DataProl.gameSceneScal;
		this.UiLayer.addChild(this.GameOver);

		this.GameOver.visible = false;

		this.userDied = new playerDied(this.wenzi, this.countDownTime);
		this.addChild(this.resurrectionBox);
		this.resurrectionBox.visible = false;

		//this.drawMap();8
		/**提高层级 */
		this.GameOver.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
			this.UiLayer.setChildIndex(this.GameOver, this.numChildren + 1);
		}, this);

	}
	/**显示复活框 */
	public showResurrectionBox() {
		this.resurrectionBox.visible = true;
		this.resurrectionBox.x = Allvariate.getInstance().FrogPoint.x;
		this.resurrectionBox.y = Allvariate.getInstance().FrogPoint.y;

	}
	public closeResurrectionBox() {
		this.resurrectionBox.visible = false;
	}



	private drawMap() {
		DrawMap.drawLineToGroup(this.drawGroup);
		/**打开  将方法里的变量修改下 */
		// DrawMap.drawHexagonToGroup(this.drawGroup);
		this.setChildIndex(this.drawGroup, 4);
		this.drawGroup.cacheAsBitmap = true;/**不要改 */
	}
	/**地图缩放初始化 */
	private mapScaleInit() {
		let scaleLayer = dynamicScaling.dynamicLayer;
		this.addChild(scaleLayer);
		this.changeParent("map");
		this.changeParent("background");
		this.changeParent("shitou");
		this.changeParent("brorder");
	}

	/**
	 * 改变父节点  仅限于此使用
	 */
	private changeParent(childName) {
		let obj = this.getChildByName(childName);
		this.removeChild(obj);
		dynamicScaling.addScalingObject(obj);
	}

    /**改变游戏内可见范围大小
	 * vis: 屏幕缩放比例
	 */
	public changeVisibility(vis) {
		egret.MainContext.instance.stage.setContentSize(gameGlobal.global.screenWidth * vis, gameGlobal.global.screenHeight * vis);
		//this.yaogan.changeVis(vis);
		//this.camera.changeVis(vis);
		this.playerPanel.changeVis(vis);
		this.GameOver.changeVis(vis);
		//this.swapChildren(this.playerPanel, this.yaogan);//改变摇杆和遮罩进游戏动画的深度，进游戏后摇杆在前


	}

	public gameStart() {
		AIServer.getInstance().roomInit();
		AIServer.getInstance().yaogan = this.yaogan;
		this.BeginTimes();
		//this.myUser.userSprit = this.m_createAllFrogs.findFrogById(DataProl.account);
		DataProl.roomTime = serverConfig.config.roomTime;
		DataProl.roomStartTime = (new Date()).valueOf();
		this.playerPanel.startRoomTimer();
	}

	/*返回大厅 */
	public backToHall() {
		//this.playerPanel.countDownTime = serverConfig.config.roomTime;//房间死亡不复活回大厅时间处理
		this.gameRest();
		//UIManager.getInstance().openFirstUI(UIManager.CLASS_UI_INDEX_LOGINMAIN);
		egret.MainContext.instance.stage.setContentSize(gameGlobal.global.screenWidth, gameGlobal.global.screenHeight);
		if (this.yaogan != null) {
			/**移除监听 避免一直发消息 */
			this.yaogan.clearYaogan();
			//添加层级处理
			this.removeUnusedLayer();
			SceneManager.instance.SitchScene(SceneName.登录场景);

			console.log("danjidenglu");
		}
		GameOver.getInstance().isGameover = true;
		if (DataProl.userCurrentDressUp.decorateId == gameShopData.getInstance().trynum) {
			wxtool.Instance.hideTrying = true;
			console.log(wxtool.Instance.hideTrying);

			/**关闭试用中 */
			if (wxtool.Instance.hideTrying == true) {
				gameShopData.getInstance().m_gameShopMgr.hideTrying();
				console.log("关闭试用中");
			}
		}

		// /**控制试用 */
		// var key: string = "1";
		// var value: string = "false";
		// egret.localStorage.setItem(key, value);

	}

	public removeUnusedLayer() {
		if (this.UiLayer == null)
			return;

		if (this.playerPanel != null) {
			this.UiLayer.removeChild(this.playerPanel);
			this.playerPanel = null;
		}
		if (this.GameOver != null) {
			this.UiLayer.removeChild(this.GameOver);
			this.GameOver = null;
		}
		if (this.yaogan != null) {
			this.UiLayer.removeChild(this.yaogan);
			this.yaogan = null;
		}
		if (this.parent != null) {
			this.parent.removeChild(this.UiLayer);
			this.UiLayer = null;
		}
		if (this.propLayer != null) {
			dynamicScaling.dynamicLayer.removeChild(this.propLayer);
			this.propLayer = null;
		}
		if (this.gameFrog != null) {
			dynamicScaling.dynamicLayer.removeChild(this.gameFrog);
			this.gameFrog = null;
		}
		if (this.roomAllTongue != null) {
			dynamicScaling.dynamicLayer.removeChild(this.roomAllTongue);
			this.roomAllTongue = null;
		}

		if (this.map != null) {
			dynamicScaling.dynamicLayer.removeChild(this.map);
			this.map = null;
		}
		if (this.background != null) {
			dynamicScaling.dynamicLayer.removeChild(this.background);
			this.background = null;
		}
		if (this.shitou != null) {
			dynamicScaling.dynamicLayer.removeChild(this.shitou);
			this.shitou = null;
		}
		if (this.brorder != null) {
			dynamicScaling.dynamicLayer.removeChild(this.brorder);
			this.brorder = null;
		}


	}
	public gameRest() {
		//this.removeEventListener(egret.Event.ENTER_FRAME, this.game_Loop, this);

		this.moveLoop.removeEventListener(egret.TimerEvent.TIMER, this.AIServerUpdate, this);
		this.moveLoop.reset();

		this.game_TimerT.removeEventListener(egret.TimerEvent.TIMER, this.showTip, this);
		this.game_TimerT.reset();
		// this.game_Timer.removeEventListener(egret.TimerEvent.TIMER, this.game_Loop, this);
		// this.game_Timer.reset();
		egret.stopTick(this.moveStar, this);
		AIServer.getInstance().gameOver();
	}

	public gameAgain() {
		DataProl.killnumMax = 0;
		this.gameRest();
		this.gameStart();
	}

	/**
	 * 摄像机初始化
	 */
	private cameraInit() {
		var cameraRect: egret.Rectangle = new egret.Rectangle(0, 0, GlobalData.GameStage_width * DataProl.gameSceneScal, GlobalData.GameStage_height * DataProl.gameSceneScal);
		this.camera = new control.Camera2D(this, cameraRect);
	}
	private onLoop(): void {
		this.camera.move();
	}
	/**地图初始化 */
	private mapInit() {
		/*房间的线 */
		dynamicScaling.addScalingObject(this.roomAllTongue);
		/**房间内的道具 */
		dynamicScaling.addScalingObject(this.propLayer);
		/**房间内的青蛙 */
		dynamicScaling.addScalingObject(this.gameFrog);
	}

	/**玩家死亡 */
	public playerDiedDis() {
		var User_list = AIServer.getInstance().getRoomUsers();
		this.GameOver.visible = true;
		this.GameOver.showTops(User_list);
		this.userDied.GameOverDis();
		GameOver.getInstance().isGameover = true;
	}

	private game_Loop_tmp_point = new egret.Point(0, 0);
	private game_Loop_Log_tmp_point = new egret.Point(0, 0);
	/**游戏循环 */

	private game_Loop() {

		var pass = (egret.getTimer() - this.timeOnEnterFrame);
		//this.aimgr.update();
		//this.accordingLineData();
		//this.displaMyInfo(this.myUser.userSprit);
		//this.playerUpdate();
		//this.checkDied();
		//this.yaogan.sendPosition();
		//	this.visualChange();

		this.check_can_breakLine();

		//this.tongueManager.updataTongue();
		this.checkTeammateInMap();

		/**影子青蛙移动 */
		//	let shadowFrog = this.m_createAllFrogs.findFrogById(DataProl.shadowFrogId);

	}
	/**重置影子青蛙状态 */
	public resetShadowForgStates() {
		serverConfig.config.shadowFrog = 1;
	}
	/**视野变化 */
	public visualChange() {
		let myFrog = this.m_createAllFrogs.findFrogById(DataProl.account);
		if (myFrog != null)
			this.scaleX = this.scaleY = 1 - myFrog.frogLineLength / 45000;
	}

	/**左上角坐标 */
	private topLeftCorner: egret.Point = new egret.Point(0, 0);
	/**右上角坐标 */
	private topRightCorner: egret.Point = new egret.Point(0, 0);
	/**左下角坐标 */
	private downLeftCorner: egret.Point = new egret.Point(0, 0);
	/**右下角坐标 */
	private downRightCorner: egret.Point = new egret.Point(0, 0);
	private nodetmp: egret.Point = new egret.Point(0, 0);

	private checkTeammatenodetmp: egret.Point = new egret.Point(0, 0);
	/**检查青蛙是否在地图上(队友指示箭头)*/
	public checkTeammateInMap() {
		if (this.m_createAllFrogs.checkPlayerIsLine()) {
			/**队友id */
			let teammateId = this.m_createAllFrogs.getLigatureUserId(DataProl.account);
			if (teammateId == null) {
				return;
			}
			/**队友 */
			let teammate = this.m_createAllFrogs.findFrogById(teammateId);
			if (teammate == null) {
				return;
			}
			/**队友基于舞台的坐标 */
			let teammateByStage: egret.Point = teammate.parent.localToGlobal(teammate.x, teammate.y, this.checkTeammatenodetmp);
			if (teammateByStage.x > 0 && teammateByStage.x < this.stage.stageWidth && teammateByStage.y > 0 && teammateByStage.y < this.stage.stageHeight) {
				this.playerPanel.teammateMark.visible = false;
				this.playerPanel.frogTag.visible = false;
				return;
			}
			/**我自己的青蛙 */
			let myFrog = this.m_createAllFrogs.findFrogById(DataProl.account);
			if (myFrog == null) {
				return;
			}
			/**自己青蛙基于舞台的坐标 */
			let myFrogByGlobal: egret.Point = myFrog.parent.localToGlobal(myFrog.x, myFrog.y);
			//console.log("队友基于舞台的坐标:" + Math.floor(teammateByStage.x) + "---------" + Math.floor(teammateByStage.y));
			//console.log("舞台边界：" + this.stage.stageHeight);
			/**箭头角度 */
			let angle = Util.getInstance().getRotation(myFrogByGlobal, teammateByStage);
			// console.log("箭头角度：" + angle);
			/**坐标偏移值 */
			let coordinateOffset: number = 5;
			/**左上角坐标 */
			this.topLeftCorner.setTo(coordinateOffset, coordinateOffset);
			/**右上角坐标 */
			this.topRightCorner.setTo(this.stage.stageWidth - coordinateOffset, coordinateOffset);
			/**左下角坐标 */
			this.downLeftCorner.setTo(coordinateOffset, this.stage.stageHeight - coordinateOffset);
			/**右下角坐标 */
			this.downRightCorner.setTo(this.stage.stageWidth - coordinateOffset, this.stage.stageHeight - coordinateOffset);
			/**交点 */
			let node;
			//上线交点
			node = Util.getInstance().segmentsIntr(teammateByStage, myFrogByGlobal, this.topLeftCorner, this.topRightCorner);
			if (node != false) {
				this.playerPanel.teammateMarkUpdate(this.nodetmp.setTo(node.x, node.y), angle, 1);
				return;
			}
			//左线交点
			node = Util.getInstance().segmentsIntr(teammateByStage, myFrogByGlobal, this.topLeftCorner, this.downLeftCorner);
			if (node != false) {
				this.playerPanel.teammateMarkUpdate(this.nodetmp.setTo(node.x, node.y), angle, 4);
				return;
			}
			//下线交点
			node = Util.getInstance().segmentsIntr(teammateByStage, myFrogByGlobal, this.downLeftCorner, this.downRightCorner);
			if (node != false) {
				this.playerPanel.teammateMarkUpdate(this.nodetmp.setTo(node.x, node.y), angle, 3);
				return;
			}
			//右线交点
			node = Util.getInstance().segmentsIntr(teammateByStage, myFrogByGlobal, this.topRightCorner, this.downRightCorner);
			if (node != false) {
				this.playerPanel.teammateMarkUpdate(this.nodetmp.setTo(node.x, node.y), angle, 2);
				return;
			}
		} else {
			this.playerPanel.teammateMark.visible = false;
			this.playerPanel.frogTag.visible = false;
		}

	}
	private timeOnEnterFrame = 0;
	/**玩家伸舌 */
	public playerLoll() {
		this.m_createAllFrogs.frogLoll();
	}
	/**检测是否可以断线 */
	private check_can_breakLine() {
		if (this.m_createAllFrogs.checkPlayerIsLine()) {
			this.playerPanel.coolDown.visible = false;
			this.playerPanel.breakLine.visible = true;
			this.playerPanel.ligature.visible = false;
		} else {
			this.playerPanel.breakLine.visible = false;
			this.playerPanel.ligature.visible = true;
		}

	}
	/**定时器*/
	private BeginTimes() {
		// this.game_Timer = new egret.Timer(1000 / 30, -1);
		// this.game_Timer.addEventListener(egret.TimerEvent.TIMER, this.game_Loop, this);
		// this.game_Timer.start();
		//this.addEventListener(egret.Event.ENTER_FRAME, this.game_Loop, this);
		this.moveLoop.addEventListener(egret.TimerEvent.TIMER, this.AIServerUpdate, this);
		this.moveLoop.start();
		if (serverConfig.config.shadowFrog == 1) {
			egret.startTick(this.moveStar, this);
		}
		this.timeOnEnterFrame = egret.getTimer();

		this.testPP();

		this.game_TimerT.addEventListener(egret.TimerEvent.TIMER, this.showTip, this);
		this.game_TimerT.start();
	}
	public testPP() {
		var count = egret.$hashCount;
		setInterval(() => {
			var newCount = egret.$hashCount;
			var diff = newCount - count;
			count = newCount;
			// console.log(diff)
		}, 1000

		);
	}

	private time: number = 0;
	private moveStar(timeStamp: number): boolean {
		var now = timeStamp;
		var time = this.time;
		let passt = now - time;
		// console.log("moveStar: ", (1000 / passt).toFixed(5));
		// console.log("pass: ", passt * 0.03);
		this.m_shadowFrog.x += (passt * 0.03);//(1 * pass*0.1);
		this.time = now;

		return false;

	}
	private showTip() {
		this.isShowTop = true;
		AIServer.getInstance().gameLoops();

	}
	/**处理服务器发来的消息 */
	public handleInformationByServer(playerdata: any) {
		if (this.isUserDied)
			return;
		//	this.playerPanel.serverHertBeatUpdata((new Date()).valueOf());//(Date.parse(new Date().toString()));
		var porpsData = playerdata.foodsList;
		var lineData = playerdata.lineList;
		var userData = playerdata.userData;
		var virusData = playerdata.virusList;

		if (porpsData != null) {
			/**更新道具 */
			this.m_propMg.propsUpdata(porpsData);
		}
		if (userData != null) {

			if (this.isShowTop) {
				/**玩家排行榜 */
				this.playerPanel.disposAllUser(userData);
				this.isShowTop = false;
			}
			//处理青蛙的移动
			this.m_createAllFrogs.disposeRoomUserMessage(userData);
			this.changebutton(userData);
			//this.diedLeaf(userData);
		}
		if (lineData != null) {
			/**处理玩家身上的线 */
			this.tongueManager.gameTongueDataUpdata(userData, lineData);
			//this.newTongueMgr.disposeRoomTongueMessage(userData, lineData);
		}
		this.onLoop();


	}
	/**飞行动画中关闭吐舌 断线按钮 */
	public changebutton(userData) {
		for (var e of userData) {
			if (e.userId == DataProl.account) {
				if (e.states != 0) {
					this.playerPanel.breakLine.alpha = 0;
					this.playerPanel.breakLine.visible = false;
					this.playerPanel.ligature.alpha = 0;
					this.playerPanel.ligature.visible = false;
				}
				else {
					this.playerPanel.breakLine.alpha = 1;
					this.playerPanel.breakLine.visible = true;
					this.playerPanel.ligature.alpha = 1;
					this.playerPanel.ligature.visible = true;
				}
			}
		}
	}
	/**显示击杀效果 */
	public disPlayKillMan(num: number) {
		if (num > DataProl.killnumMax) {
			DataProl.killnumMax = num;
		}
		this.playerPanel.frogKillMan(num);
		if (num == 1) {
			SoundManager.getInstance().playEffectSound("firstblood_mp3");
		}
		else if (num == 2) {
			SoundManager.getInstance().playEffectSound("doublekill_mp3");
		}
		else if (num == 3) {
			SoundManager.getInstance().playEffectSound("triplekill_mp3");
		}
		else if (num == 4) {
			SoundManager.getInstance().playEffectSound("quatarykill_mp3");
		}
		else if (num == 5) {
			SoundManager.getInstance().playEffectSound("pentakill_mp3");
		}
		else if (num > 5 && num <= 10) {
			SoundManager.getInstance().playEffectSound("killingspree_mp3");
		}
		else if (num > 10 && num <= 20) {
			SoundManager.getInstance().playEffectSound("monsterkill_mp3");
		}
		else if (num > 20 && num <= 30) {
			SoundManager.getInstance().playEffectSound("godlike_mp3");
		}
		else if (num > 30) {
			SoundManager.getInstance().playEffectSound("legendary_mp3");
		}
	}

	/**将玩家信息显示出来 */
	public displaMyInfo(player: any) {
		this.lenght11 = player.lineLength;
		this.playerPanel.displayUserTongueLength(player.grade);
		var playertyp = player.frogType + 1 >= serverConfig.config.maxtype + 1 ? 0 : player.frogType + 1;
		this.playerPanel.displayUserClothesUpdata(playertyp);
	}

	private yaoganInit() {
		this.yaogan = new roleControl();
		this.UiLayer.addChild(this.yaogan);
		this.yaogan.yaoganInit(this.stage);
	}

	// 发送给服务器玩家的位置
	public senMessageForServerPosition(point) {
		//道具醉酒
		if (this.myUser.userSprit.nowPropsType[3] == 4) {
			if (Date.now() - this.daotime >= 1000) {
				this.rr = Math.round(Math.random() * 360)
				this.daotime = Date.now();
			}
			point.x = Math.sin(this.rr / 57.3) * 815;
			point.y = Math.cos(this.rr / 57.3) * 815;
		}

		if (point.y == 0 && point.x == 0) {
			//console.log("停止");
			return;
		}
		var movedata = {
			"target": point,
		}
		AIServer.getInstance().clientMove(movedata);
	}
	//提交玩家自己的青蛙

	public creatMyFog() {

		// if (wxtool.Instance.test == true && egret.localStorage.getItem("1") == "true") {
		// 	this.m_createAllFrogs.getMyFrog(DataProl.account, DataProl.login_data.nickName, GlobalData.GameStage_width * DataProl.gameSceneScal / 2, GlobalData.GameStage_height * DataProl.gameSceneScal / 2, 0, 11, DataProl.try);
		// 	wxtool.Instance.test = false;
		// 	console.log(4567875656);
		// 	console.log(wxtool.Instance.test);
		// }
		// else {
		this.m_createAllFrogs.getMyFrog(DataProl.account, DataProl.login_data.nickName, GlobalData.GameStage_width * DataProl.gameSceneScal / 2, GlobalData.GameStage_height * DataProl.gameSceneScal / 2, 0, 11, DataProl.userCurrentDressUp);
		console.log("玩家自己16496464611541546465");
		// }

		this.myUser.targetx = this.myUser.userSprit.x;
		this.myUser.targety = this.myUser.userSprit.y;



	}
	public tongueManager: tongueMgr = new tongueMgr(this.roomAllTongue, this.m_createAllFrogs);
}